<?php
$title = 'Ticket history for ' . $client->getDisplayableName();
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1>
<a href="<?php echo $this->url('reportticket', array('action'=>'newTicket','id'=>$client->getId()));?>">Add a new ticket</a>
<table class="table">
    <tr>
        <th>Closed</th>
        <th>Title</th>
        <th>Time</th>
        <th>&nbsp;</th>
    </tr>
    <?php foreach ($tickets as $ticket) : ?>
        <tr>.
            <td><?php echo $this->escapeHtml($ticket->getClosed()) ? "Closed" : "Open"; ?></td>
            <td><?php echo $this->escapeHtml($ticket->getTitle()); ?></td>
            <td><?php echo $this->escapeHtml($ticket->getTime()->format('d-m-Y H:i')); ?></td>
            <td>
                <a href="<?php echo $this->url('ticket', array('action' => 'view', 'id' => $ticket->getId())); ?>">View</a>
            </td>
        </tr>
    <?php endforeach; ?>
    <?php if(empty($tickets)): ?>
        <tr>
            <td colspan="4">No tickets</td>
        </tr>
    <?php endif; ?>
</table>